package com.jt.contoller;

import com.jt.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @outhor fufeixiang
 * @date 2021-05-06
 */
@Controller
//@RestController //@Controller + @ResponseBody 该类中所有方法的返回值的都是json串
public class JSONController {
    @RequestMapping("/getJSON")
    @ResponseBody
    public User getJSON(){
        User user = new User();
        user.setName("ffx").setId(110);
        return user;
    }
}
